<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('通用选择')" />
	<th:block th:include="include :: list-css" />
	<style type="text/css">
		.layui-col-xs3{min-width:280px}
		.layui-elem-quote{padding:0;font-weight: 500;}
		.upThis-css{position:absolute;z-index:999;top:0;width:100%}
		.mid-content{overflow-y: auto;}
	</style>
</head>
<body>
<div class="main-content">
	<div class="content-right">
		<div class="search-top">
			<span>查询条件</span>
			<a href="javascript:;" layadmin-event="flexible" class="menuBtn">
				<i class="layui-icon layui-icon-spread-left" id="LAY_app_flexible" style="color: #fff;"></i>
			</a>
		</div>
		<div class="panel layout-expand layui-expand-east">
		    <div class="panel-header">
		        <div class="panel-tool" style="text-align: center; width: 26px;height: 30px;line-height: 30px;">
		            <a href="javascript:;" layadmin-event="flexible" class="menuBtn">
		                <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible" style="color: #fff;"></i>
		            </a>
		        </div>
		    </div>
		    <div class="panel-body panel-title" style="text-align: center; width: 26px;">查<br>询<br>条<br>件</div>
		</div>
       	<form class="layui-form">
			<th:block th:include="listinclude :: searchRight('pagecallin')" />
		</form>
   	</div>
   	<div>
    <div th:if="${#httpServletRequest.getParameter('pagetype') eq 'checkbox'}" class="mid-content" style="top: 0px;">
		<div class="layui-col-md12">
			<blockquote class="layui-elem-quote" style="padding: 0px 10px;">
				<table class="layui-inline layui-hide" id="dhtable" lay-filter="ftable"></table>
			</blockquote>
		</div>
		<div class="layui-col-md12 upThis">
			<blockquote class="layui-elem-quote" style="padding: 0px 10px;">
				<table class="layui-inline layui-hide" id="dhtable2" lay-filter="ftable2"></table>
			</blockquote>
		</div>
    </div>
    <div th:unless="${#httpServletRequest.getParameter('pagetype') eq 'checkbox'}" class="mid-content" style="top: 0px;">
    	<table class="layui-hide" id="dhtable" lay-filter="ftable"></table>
    </div>
</div>
<script type="text/html" id="toolbar">
<div class="layui-btn-container" style="margin-top: 10px">
	<div class="layui-btn addbtn {{ tb1s?'':'layui-btn-disabled' }} layui-table-tools" lay-event="add">
		<i class="dhicon dh-angle-double-down"></i> 添加
	</div>
	<div class="layui-btn delbtn {{ tb2s?'':'layui-btn-disabled' }} layui-table-tools layui-btn-danger" lay-event="del">
		<i class="dhicon dh-angle-double-up"></i> 移除
	</div>
</div>
</script>
<th:block th:include="include :: footer" />
<th:block th:include="include :: searchJS" />
<th:block th:include="listinclude :: list-templeat" />
<script th:inline="javascript">
	/*<![CDATA[*/
	var prefix = ctx +[[${prefix}]];
	var gridColumns = [[${gridColumns}]];
	var moduleTable=[[${moduleTable}]];
	var customerInfo=[[${customerInfo}]];//选择销售员需要
	var providerInfo=[[${providerInfo}]];//选择采购员需要
	var warehouseAddress=[[${warehouseAddress}]];//海外仓发货申请需要
	var productcode=[[${productcode}]];//海外仓发货申请需要
	var vGsBm=[[${vGsBm}]];//海外仓发货申请需要
	var noChooseList=[[${noChooseList}]];//海外仓发货申请需要
	var fmoduleTable=[[${fmoduleTable}]];
    var vtype = [[${vtype}]];//基础数据分项
    var multiple = [[${#httpServletRequest.getParameter('pagetype') == 'checkbox'}]];//是否多选
	// console.log("moduleTable",moduleTable)
	/*]]>*/
</script>
<script type="text/javascript">
var wlh = window.location.href,wlhPars = wlh.split('?')[1]?('&'+wlh.split('?')[1]):'';
var $,layer,table,form,laydate,wherestr={},listUrl='',tb1s=false,tb2s=false,dataStr = [];
// console.log(moduleTable,wlhPars,1);
switch(moduleTable){//特殊判断，moduleTable不同数据源不同
	case 'TP_STOCKBARGAININ'://合同选择(使用分组整单数据源)
	case 'TP_LOGSTICSPATTERN'://物流名称
		listUrl=prefix+'/list?deletedtext=1'+wlhPars;
		gridColumns.gridBody=[
			{type:'numbers', fixed: 'left'}
			,{type:'radio'}
			,{field:'code', title: '物流编码',width: 250}
			,{field:'name', title: '物流名称',width: 250}
			,{field:'nameLogsticsWay', title: '物流方式',width: 250}
			,{field:'codeCompany', title: '物流渠道账户编码',width: 250}
			,{field:'nameCompany', title: '物流渠道账户简称',width: 250}
			,{field:'nameLogsticsClearance', title: '清关方式',width: 250}
			,{field:'stateShareTicketName', title: '是否拼票',width: 250}
			,{field:'stateShareTicket',hide:true, title: '是否拼票',width: 250}
			,{field:'logsticsTimeLimit', title: '物流时效',width: 250}
			,{field:'priceSingleBoxReq', title: '单箱采购价要求(￡)',width: 250}
			,{field:'weightTranFrom', title: '起运重量(kg)',width: 250}
			,{field:'weightCalBySingle', title: '单箱计重标准(kg)',width: 250}
			,{field:'priceCalPerKg', title: '重量计费标准(￥/kg)',width: 250}
			,{field:'coefficientWeight', title: '抛重系数',width: 250}
			,{field:'numFreeProName', title: '品名免费数量',width: 250}
			,{field:'numMaxProName', title: '品名上限数量',width: 250}
			,{field:'priceProNamePerOne', title: '品名计费标准(￥/个)',width: 250}
			,{field:'priceSingleExtra', title: '单票单件附加费(￥)',width: 250}
			,{field:'priceClearanceOpe', title: '清关操作费(￥)',width: 250}
			,{field:'priceQualityExtraPerKg', title: '最小单箱重量',width: 250}
			,{field:'zysx', title: '注意事项',width: 250}
		]
		break;
	case 'TP_STOCKBARGAININGROUP'://销售合同
	case 'TCRM_BUSINESSINFO'://商机信息
	case 'TCRM_BUSINESSINFOGROUP'://商机信息
		listUrl=prefix+'/group/list?effectStock=1'+wlhPars;
		break;
	case 'TP_STOCKPROJECTADDED'://项目选择（根据客户名称过滤）
		listUrl=prefix+'/listWithGCName?effectStock=1&blxr=1'+wlhPars;
		break;
	case 'TB_CUSTOMERINFO'://客户选择
		$.each(wlh.substring(wlh.indexOf('?')+1,wlh.length).split('&'),function(v,k){
			listUrl+=k+'&';
		})
		listUrl=prefix+'/listbypersion?'+listUrl;
		break;
	case 'TB_PROVIDERINFO'://供应商选择
		$.each(wlh.substring(wlh.indexOf('?')+1,wlh.length).split('&'),function(v,k){
			listUrl+=k+'&';
		})
		listUrl=prefix+'/listbypersion?'+listUrl;
		break;
	case 'TS_USERINFO'://销售员、采购员选择
		$.each(wlh.substring(wlh.indexOf('?')+1,wlh.length).split('&'),function(v,k){
			if(k.split('=')[0] == 'roleType')listUrl="/system/user/roletypelist?roleType="+k.split('=')[1]+'&';//按条件查询指定角色类型（客户销售）用户列表 —— 精简数据
			else listUrl+=k+'&';
		})
		if(customerInfo){//针对共享
			if(customerInfo.bShared==1){
				listUrl="/system/user/list";
			}else{
				listUrl=prefix+"/usermap?effectStock=1&gClient="+customerInfo.gClient;
			}
		}
		if(providerInfo){//针对共享
			if(providerInfo.bShared==1){//共享则查询所有
				listUrl="/system/user/list";
			}else{
				listUrl=prefix+"/usermap?effectStock=1&gprovide="+providerInfo.gprovide;
			}
		}
		break;
	case 'TS_DEPOTINFO'://仓库选择
		listUrl=prefix+'/list?effectStock=1'+wlhPars;
		gridColumns.gridBody=[
            {type:'numbers', fixed: 'left'}
            ,{type:'radio'}
            ,{field:'depotId', title: '仓库编码',align: 'center'}
            ,{field:'depotName', title: '仓库名称',align: 'center'}
            ,{field:'cidName', title: '所属公司',align: 'center'}
            ,{field:'codeLogsticsServer', title: '物流服务商',align: 'center'}
            ,{field:'freeChannel', title: '免收渠道',align: 'center'}
            ,{field:'warehousingCharge', title: '入库费用标准',align: 'center'}
        ]
		break;
	case 'TS_ORGANIZATIONINFO'://组织机构选择
		listUrl=prefix+'/list?orgKind=dept';
		gridColumns.gridBody=[
			{type:'numbers', fixed: 'left'}
			,{type:'radio'}
			,{field:'orgName', title: '部门名称',width: 150}
			,{field:'cidName', title: '所属公司',width: 250}
			,{field:'orgPathNameAll', title: '部门路径',width: 666}
        ]
		break;
	case 'THR_USERPERFORMANCERULE'://员工绩效规则
		listUrl=prefix+'/list2';
		gridColumns.gridBody=[
			{type:'numbers', fixed: 'left'}
			,{type:'radio'}
			,{field:'fKhGw', title: '考核岗位',width: 250}
			,{field:'fKhXm', title: '考核项目',width: 250}
			,{field:'fKhZb', title: '考核占比',width: 250}
			,{field:'fKhNr', title: '内容',width: 250}
			,{field:'fKhBz', title: '标准',width: 250}
			,{field:'fTjXm', title: '提奖项目',width: 250}
			,{field:'fTjQz', title: '提奖取值',width: 250}
			,{field:'fTjXs', title: '提奖系数',width: 250}
        ]
		break;
	case 'THR_USERWELFARE'://员工福利申请
		listUrl=prefix+'/list';
		gridColumns.gridBody=[
			{type:'numbers', fixed: 'left'}
			,{type:'radio'}
			,{field:'gUser', title: '工号',width: 250}
			,{field:'gDeptName', title: '部门',width: 250}
			,{field:'gUserName', title: '姓名',width: 250}
			,{field:'vGw', title: '岗位',width: 250}
			,{field:'vGsBm', title: '公司编码',width: 250}
			,{field:'vGsMc', title: '公司名称',width: 250}
        ]
		break;
	case 'THR_USERSALARY'://员工福利申请
		listUrl=prefix+'/list2';
		gridColumns.gridBody=[
			{type:'numbers', fixed: 'left'}
			,{type:'radio'}
			,{field:'gUser', title: '工号',width: 250}
			,{field:'gDeptName', title: '部门',width: 250}
			,{field:'gUserName', title: '姓名',width: 250}
			,{field:'vGw', title: '岗位',width: 250}
			,{field:'vGsBm', title: '公司编码',width: 250}
			,{field:'vGsMc', title: '公司名称',width: 250}
        ]
		break;
	case 'THR_USERRANK'://职级管理
		listUrl=prefix+'/list';
		gridColumns.gridBody=[
			{type:'numbers', fixed: 'left'}
			,{type:'radio'}
			,{field:'rankID', title: '职级编码',width: 180}
			,{field:'rank', title: '职级名称',width: 180}
			,{field:'wageType', title: '薪资类型',width: 180}
			,{field:'bid', title: '单号',width: 180}
        ]
		break;
	case 'TCG_PURCHASEPLAN'://采购计划
		listUrl=prefix+'/list?'+wlhPars;
		gridColumns.gridBody=[
			{type:'numbers', fixed: 'left'}
			,{type:'radio'}
			// ,{field:'nid', title: '单据编号',width: 250}
			,{field:'bid', title: '计划单号',width: 250}
			,{field:'spBm', title: '商品编码',width: 250}
			,{field:'spMc', title: '商品名称',width: 250}
			,{field:'spSl', title: '采购数量',width: 250}
			,{field:'planCost', title: '计划金额',width: 250}
        ]
		break;
	case 'TCG_PURCHASEORDER'://采购订单
		listUrl=prefix+'/list';
		gridColumns.gridBody=[
			{type:'numbers', fixed: 'left'}
			,{type:'radio'}
			,{field:'bid', title: '单据编号',width: 250}
			,{field:'account', title: '1688账号',width: 250}
			,{field:'orderNumber', title: '1688订单编号',width: 250}
			,{field:'orderAmount', title: '采购订单金额',width: 250}
			,{field:'freightCharge', title: '采购运费',width: 250}
			,{field:'serviceCharge', title: '采购服务费',width: 250}
        ]
		break;
	case 'TCG_ORDERALL'://采购订单
		listUrl=prefix+'/selectAllOrder';
		gridColumns.gridBody=[
			{type:'numbers', fixed: 'left'}
			,{type:'radio'}
			,{field:'bid', title: '采购单号',width: 200}
			,{field:'planID', title: '计划单号',width: 200}
			,{field:'code', title: '商品编码',width: 200}
			,{field:'name', title: '商品名称',width: 200}
			,{field:'scode', title: '子件编码',width: 200}
			,{field:'sname', title: '子件名称',width: 200}
			,{field:'orderAmount', title: '订单金额',width: 200}
			,{field:'freightCharge', title: '采购运费',width: 200}
			,{field:'serviceCharge', title: '采购服务费',width: 200}
			,{field:'aliLogisticsCode', title: '物流单号',width: 200}
			,{field:'aliPlace', title: '物流渠道',width: 200}
        ]
		break;
	case 'TP_PRODUCTACTIVECOMPONENT'://商品子件表
		listUrl=prefix+'/listson?'+wlhPars;
		gridColumns.gridBody=[
			{type:'numbers', fixed: 'left'}
			,{type:'checkbox'}
			,{field:'pcode', title: '商品编码',width: 200}
			,{field:'pName', title: '商品名称',width: 200}
			,{field:'code', title: '子件编码',width: 200}
			,{field:'name', title: '子件名称',width: 200}
			,{field:'num', title: '子件数量',width: 200}
			,{field:'remark', title: '子件备注',width: 200}
        ]
		break;
	case 'TP_PRODUCTACTIVE_NFSKU'://商品表
		listUrl=prefix+'/list?'+wlhPars;
		gridColumns.gridBody=[
			{type:'numbers', fixed: 'left'}
			,{type:'radio'}
			,{field:'code', title: '商品编码',width: 200}
			,{field:'name', title: '商品名称',width: 200}
			,{field:'vFNSKU', title: 'FNSKU',width: 200}
        ]
		break;
	case 'TP_PRODUCTACTIVE_YP'://修改后的商品信息
		listUrl=prefix+'/list2?'+wlhPars;
		gridColumns.gridBody=[
			{type:'numbers', fixed: 'left'}
			,{type:'radio'}
			,{field:'code', title: '商品编码'}
			,{field:'name', title: '商品名称'}
			,{field:'codeMerge', title: '合并商品编码'}
		]
		break;
	case 'HW_DELIVERYREQUEST_LOCATION'://海外仓发货申请
		listUrl = "/storage/deliveryRequest/findFbaProductByDeliveryRequestDetail?warehouseAddress="+warehouseAddress+"&productcode="+productcode+"&vGsBm="+vGsBm+"&noChooseList="+noChooseList
		gridColumns.gridBody=[
			{type: 'numbers', fixed: 'left'}
			,{type:'radio'}
			, {field: 'vHw', title: '货位编码', align: 'center',width: 200}
			, {field: 'vKq', title: '库区', align: 'center',width: 200}
			, {field: 'gDepot', title: '所在仓库', align: 'center',width: 200}
			, {field: 'productNum', title: '可用数量', align: 'center',width: 200}
			, {field: 'vGsBm', title: '所属公司编码', align: 'center',width: 200}
			, {field: 'vGsJc', title: '所属公司简称', align: 'center',width: 200}
		]
		break;
	case 'TCC_STOCKCONTROL'://商品表
			if(fmoduleTable=='HW_DELIVERYREQUEST_LOCATION'){
				listUrl = "/storage/deliveryRequest/findFbaProductByDeliveryRequestDetail?warehouseAddress="+warehouseAddress+"&productcode="+productcode+"&vGsBm="+vGsBm
				gridColumns.gridBody=[
					{type: 'numbers', fixed: 'left'}
					,{type:'radio'}
					, {field: 'vHw', title: '货位编码', align: 'center',width: 200}
					, {field: 'vKq', title: '库区', align: 'center',width: 200}
					, {field: 'gDepot', title: '所在仓库', align: 'center',width: 200}
					, {field: 'productNum', title: '可用数量', align: 'center',width: 200}
					, {field: 'vGsBm', title: '所属公司编码', align: 'center',width: 200}
					, {field: 'vGsJc', title: '所属公司简称', align: 'center',width: 200}
				]
			}else {
				listUrl=prefix+'/list?'+wlhPars;
			}
		break;
	// case 'TP_FBAPLANORDER'://头程计划
	// 	listUrl=prefix+'/list';
	// 	gridColumns.gridBody=[
	// 		{type:'numbers', fixed: 'left'}
	// 		,{type:'radio'}
	// 		,{field:'nid', title: '单据编号',width: 250}
	// 		,{field:'bid', title: '计划单号',width: 250}
	// 		,{field:'spBm', title: '商品编码',width: 250}
	// 		,{field:'spMc', title: '商品名称',width: 250}
	// 		,{field:'spSl', title: '采购数量',width: 250}
	// 		,{field:'planCost', title: '计划金额',width: 250}
    //     ]
	// 	break;
	case 'TB_baseinfo_maillabel'://邮件标签选择
		listUrl=prefix+'/list?effectStock=1'+wlhPars;
		gridColumns.gridBody=[
			{type:'numbers', fixed: 'left'}
			,{type: 'checkbox'}
			,{field:'vname', title: '邮件标签',align: 'center',width: 180}
        ]
		break;
	case 'TCRM_WEEKLYPLAN'://计划选择
		listUrl=prefix+"/list?by=buser&vtype="+vtype;
		break;
	case 'BOUNDCOMPAN'://绑定公司选择
		listUrl=prefix+'/list2?effectStock=1'+wlhPars;
		break;
	case 'TCW_FinancesEventGroups'://财务事件分组
		listUrl=prefix+'/list2?effectStock=1'+wlhPars;
		break;
	case 'TS_CHANNELCODE'://渠道代码
		listUrl=prefix+'/list?'+wlhPars;
		break;
	case 'TS_CargoMaintenance'://货物报关
		listUrl=prefix+'/list2?'+wlhPars;
		break;
	default:
// 		if(parent.moduleTable=='THR_TRAININGNEEDS')listUrl;
		listUrl=prefix+'/list?effectStock=1'+wlhPars;
		break;
}
if(vtype)listUrl=prefix+"/list?vtype="+vtype;//单独判断基础数据
layui.use(['table','layer','jquery','form','laydate'], function () {
	$ = layui.$,layer = layui.layer,table = layui.table,form = layui.form,laydate=layui.laydate;
	serachRender();//查询条件初始渲染集合
    $.tablelist.init({
        elem: '#dhtable'
        ,url: listUrl
        ,cols: [gridColumns.gridBody
        ]
        ,height: multiple?'full-350':'full-16'
    });
	if(multiple){//如果是多选，则加载已选区表格
	    $.tablelist.init({
	        elem: '#dhtable2'
			,toolbar:'#toolbar'
			,defaultToolbar: [{title:'展开',layEvent:'tableUp',icon:'layui-icon-screen-full'}]
	        ,cols: [gridColumns.gridBody
	        ]
	    	,data:dataStr
	        ,height:'320'
	    });
	}
	table.on('row(ftable)', function(obj){
		if(moduleTable != 'TB_baseinfo_maillabel') {//邮件标签checkbox
			obj.tr.find('input[lay-type="layTableRadio"]').prop("checked", true);
			if(!multiple){//单选情况下：重置其他数据选择
				var index = obj.tr.data('index')
				var thisData = table.cache.dhtable;	//dhtable 表名
				layui.each(thisData, function (i, item) {
					if (index === i) {
						item.LAY_CHECKED = true;
					} else {
						delete item.LAY_CHECKED;
					}
				});
				form.render('radio');
			}
		}
   	});

	setTimeout(function(){
		if(moduleTable==="TP_PRODUCTACTIVECOMPONENT" || parent.moduleTable === 'TCG_DISTRIBUTION'){
			var tcval=sessionStorage.getItem('tcval')

			// console.log("tcval",tcval)
			tcval=tcval.replace(/\s*/g,"")
			$.get('/business/productactive/listselectzj?selectedUser='+tcval,function(res){
				if(tcval){
					tcval=tcval.split(',')
					var dataAll=res.data
					// var listdata=JSON.parse(JSON.stringify(table.cache.dhtable))
					dataStr=[]
					dataAll.map((v,k)=>{
						tcval.map((n,m)=>{
							if(v.code==n){
								dataStr.push(v)
							}
						})
					})
					table.reload('dhtable2',{data:dataStr});
				}
			})
		}
	},500)

	//双击行事件：查看单据
	table.on('rowDouble(ftable)', function(obj){
		var data = [obj.data];
		$.each(data,function(i,v){
	    	var flag = false;
	    	for(var j=0; j < dataStr.length; j++){
	    		if(v.guid == dataStr[j].guid)flag = true;			
	    	}
	    	if(!flag)dataStr.push(v);	//排除已选中
	    });
		table.reload('dhtable2',{totalRow:dataStr.length?gridColumns.totalRow:false,data:dataStr});
	    $('.layui-table-body').find('.layui-form-checked').click();
	    $('.laytable-cell-checkbox').find('.layui-form-checked').click();
	    $(".addbtn").addClass("layui-btn-disabled");
	    tb1s=false;
		switch(moduleTable){
// 			case 'THR_POSITIONINSTRUCTIONS'://hr——档案信息
// 				break;
			default://普通打开单据页面
				if(obj.data.nid)top.layui.index.openTabsPage(prefix+'/edit?nid='+obj.data.nid, gridColumns.moduleAlias+'('+obj.data.bid+')');
				break;
		}
    });
	//双击删除表二
	table.on('rowDouble(ftable2)', function(obj){
		var data = [obj.data];
		$.each(data,function(i,v){
			for(var j=0; j < dataStr.length; j++){
				if(v.guid == dataStr[j].guid)dataStr.splice(j,1);
			}
		});
		table.reload('dhtable2',{totalRow:dataStr.length?gridColumns.totalRow:false,data:dataStr});
		$(".delbtn").addClass("layui-btn-disabled");
	    tb2s=false;
	})
	//头部event事件
	table.on('toolbar(ftable2)', function(obj){
	    switch(obj.event){
	    	case 'add'://添加
	    		var checkStatus = table.checkStatus('dhtable'),data = [];
	    	    data = checkStatus.data;
	    	   	$.each(data,function(i,v){
	    	   		var flag = false;
	    	   		for(var j=0; j < dataStr.length; j++){
	    				if(v.guid == dataStr[j].guid)flag = true;			
	    			}
	    	   		if(!flag)dataStr.push(v);	//排除已选中
	    	   	});
				if (moduleTable === 'TB_baseinfo_spcz' && dataStr.length>3){
					return $.modal.msgWarning('材质最多选择3种！');
				}
	    	   	table.reload('dhtable2',{data:dataStr});
	    	   	$('.layui-table-body').find('.layui-form-checked').click();
	    	   	$('.laytable-cell-checkbox').find('.layui-form-checked').click();
	    	   	$(".addbtn").addClass("layui-btn-disabled");
	        	tb1s=false;
	    	break;
	    	case 'del'://移除
	    		var checkStatus = table.checkStatus('dhtable2'),data = [];
		    	data = checkStatus.data;
		    	$.each(data,function(i,v){
		    		for(var j=0; j < dataStr.length; j++){
		    			if(v.guid == dataStr[j].guid)dataStr.splice(j,1);
		    		}
		    	});
		    	table.reload('dhtable2',{data:dataStr});
		    	$(".delbtn").addClass("layui-btn-disabled");
	        	tb2s=false;
	    	break;
	    	case 'tableUp'://已选区展开
	    		table.reload('dhtable2',{defaultToolbar: [{title:'收缩',layEvent:'tableDown',icon:'layui-icon-screen-restore'}],height:$(window).height()});
	    		$('.upThis').addClass('upThis-css');//添加绝对定位样式
         	break;
	    	case 'tableDown'://已选区收缩
	    		table.reload('dhtable2',{defaultToolbar: [{title:'展开',layEvent:'tableUp',icon:'layui-icon-screen-full'}],height:'350'});
	    		$('.upThis').removeClass('upThis-css');//移除样式
	    	break;
	    }
	});
	//点击table行选中复选框
	$(document).on('click', '.layui-table-view tbody tr', function(event) {
		var elemTemp = $(this);
		var tableView = elemTemp.closest('.layui-table-view');
		var trIndex = elemTemp.data('index');
		tableView.find('tr[data-index="' + trIndex + '"]').find('[name="layTableCheckbox"]+').last().click();
	});
	//点击复选框阻止冒泡,改变按钮样式
    $(document).on("click",".layui-form-checkbox",function(e){
       	e.stopPropagation();
        var checkStatus = table.checkStatus('dhtable');
        var checkStatus2 = table.checkStatus('dhtable2');
        var data = checkStatus.data, 
        	data2 = checkStatus2.data;
        if(data.length > 0){
        	tb1s=true;
        	$(".addbtn").removeClass("layui-btn-disabled");
        }else{
        	tb1s=false;
        	$(".addbtn").addClass("layui-btn-disabled");
        }
        if(data2.length > 0){
        	tb2s=true;
        	$(".delbtn").removeClass("layui-btn-disabled");
        }else{
        	tb2s=false;
        	$(".delbtn").addClass("layui-btn-disabled");
        }
        
    });
	//监听排序事件
    table.on('sort(ftable)', function(obj){
    	$.tablelist.sort('dhtable',obj);
    });
});
var callbackdata = function (type) {//回调函数
	if(moduleTable == 'TP_PRODUCTINFO'){//目前产品选择正常返回数据
   		return dataStr;
	}else{
		if(multiple){//多选
			console.log('type---', type);
			// console.log("1",moduleTable,dataStr)
			// 11代表移仓单调用
			if(type != undefined && type != null && type == 11) {
	            return dataStr;
			} else {
				$.each(dataStr,function(i,v){
					if(i>0)$.each(v,function(j,k){
						dataStr[0][j]+=','+(k?k:'');//将多条数据每个属性拼接到第一条数据，以,区分
					})
				})
				return dataStr[0];
			}
		}else{//单选
			if(table.checkStatus('dhtable').data.length>0){
				if(moduleTable == 'TB_baseinfo_maillabel')return returnData;
				else return table.checkStatus('dhtable').data[0];
			}else return "none";
		}
	}
}


</script>
</body>
</html>